# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Artem Vorotnikov <artem@vorotnikov.me>

_gemname=rspec-mocks
pkgname=ruby-${_gemname}
pkgver=3.12.0
pkgrel=1
pkgdesc="RSpecs 'test double' framework, with support for stubbing and mocking"
url='https://github.com/rspec/rspec-mocks'
arch=('any')
license=('MIT')
depends=('ruby-rspec-support' 'ruby-diff-lcs')
options=('!emptydirs')
source=(https://rubygems.org/downloads/${_gemname}-${pkgver}.gem)
noextract=(${_gemname}-${pkgver}.gem)
sha512sums=('eb4a54ac73736e2648c8c14cac1362bafd59452ca54e18f4feb9caa5c5412a449c1cdd9909bd8bfb17f3bcb83c189ab722cbdd409b3942c09f12f427742fd964')

package() {
  local _gemdir="$(ruby -e'puts Gem.default_dir')"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}/usr/bin" ${_gemname}-${pkgver}.gem
  find "${pkgdir}"
  install -Dm 644 "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm 644 "${pkgdir}${_gemdir}/gems/${_gemname}-${pkgver}/README.md" "${pkgdir}/usr/share/doc/${pkgname}/README"
  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
